﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Reconciliation.Data
{
    public partial class Transaction
    {
        public static List<Domain.Transaction> GetExpectedReturn(int orderID)
        {
            List<Domain.Transaction> domainTransactionList = new List<Reconciliation.Domain.Transaction>();
            ReconciliationEntities recEnt = new ReconciliationEntities();
            domainTransactionList = (from tr in recEnt.Transaction.Include("Order").
                                     Where(t => t.Order.OrderID.Equals(orderID))
                                     select new Domain.Transaction
                                     {
                                         Balance = tr.Balance,
                                         DateTime = tr.DateTime,
                                         Dispensed = tr.Dispensed,
                                         OrderID = tr.Order.OrderID,
                                         TransactionID = tr.TransactionID
                                     }).ToList();
            return domainTransactionList;
        }
    }
}
